//default color theme is "Pomotroid" from Pomotroid software I'm mimicking.
export global Theme {
    in-out property <int> theme-idx: 0;
    in-out property <brush> long-round: #af486d;
    in-out property <brush> short-round: #719002;
    in-out property <brush> focus-round: #3c73b8;
    in-out property <brush> background: #1a191e;
    in-out property <brush> background-light: #343132;
    in-out property <brush> background-lightest: #837c7e;
    in-out property <brush> foreground: #dfdfd7;
    in-out property <brush> foreground-darker: #bec0c0;
    in-out property <brush> foreground-darkest: #adadae;
    in-out property <brush> accent: #cd7a0c;
    in-out property <length> letter-spacing: 3px;
    in-out property <image> logo: @image-url("../assets/logo.svg");
}

//@rust-attr(derive(serde::Deserialize))
export struct JsonTheme {
    name: string,
    long-round: brush,
    short-round: brush,
    focus-round: brush,
    background: brush,
    background-light: brush,
    background-lightest: brush,
    foreground: brush,
    foreground-darker: brush,
    foreground-darkest: brush,
    accent: brush,
}

export enum BoolSettTypes {
    AlwOnTop,
    BrkAlwOnTop,
    AutoStrtWrkTim,
    AutoStrtBreakTim,
    TickSounds,
    TickSoundsBreak,
    Notifications,
    MinToTray,
    MinToTryCls,
}

export enum IntSettTypes {
    LongBreak,
    ShortBreak,
    Work,
    Volume,
    Rounds,
}

//@rust-attr(derive(serde::Deserialize))
export struct ConfigData {
    name: string,
    state: bool,
    sett-param: BoolSettTypes,
    enabled: bool,
    animate-in: bool,
    animate-out: bool,
}

export global Settings {
    in-out property <bool> always-on-top;
    in-out property <bool> auto-start-break-timer;
    in-out property <bool> auto-start-work-timer;
    in-out property <bool> break-always-on-top;

    //in-out property<...shortcuts...> global-shortcuts;
    //I'm thinking instead of strings, I need to set this to a struct
    //that can match the json variant I seralize/deserialize
    //then have a slint function to convert it to a string format?
    //or would I need to store both properties here? A string version
    //generated in rust and the struct version?
    in-out property<string> tt_ghk;
    in-out property<string> rst_ghk;
    in-out property<string> skp_ghk;

    in-out property <bool> min-to-tray;
    in-out property <bool> min-to-tray-on-close;
    in-out property <bool> notifications;
    in-out property <string> theme;
    in-out property <bool> tick-sounds;
    in-out property <bool> tick-sounds-during-break;
    in-out property <int> time-long-break;
    in-out property <int> time-short-break;
    in-out property <int> time-work;
    in-out property <int> volume;
    in-out property <int> work-rounds;

    in property<bool> is-wayland;

    //hmm so maybe an enum with each setting in it, and can pass the enum to the callback?
    //but I guess I would a callback for each type, ie a bool-changed, int-changed, etc?
    //Is there a cleaner way? I'm trying to avoid one call back for each setting
    //pure callback setting-changed(SettingVal, enum of Settings?)

    callback bool-changed(BoolSettTypes, bool);
    callback int-changed(IntSettTypes, int);
}
